<?php $paginator = $this->Paginator; ?>
<div class="row-fluid">
    <div class="span12">
        <?php echo $this->element('message'); ?>   
        <div class="page-header">
            <h1>Settings</h1>
        </div>
        <table class="table table-bordered table-striped">
        <!-- <table class="datagrid"> -->
            <thead>
                <tr>
                    <th><?php echo $paginator->sort('id', 'ID') ?></th>
                    <th><?php echo $paginator->sort('key', 'Key') ?></th>
                    <th><?php echo $paginator->sort('value', 'Value') ?></th>      
                    <th>Actions</th>
                </tr>
            </thead>
            <tbody>
                <?php
                foreach ($rows as $row) {
                    $rd_id = rand(1000000000, 9999999999);
                    echo "<tr>";
                    echo "<td>{$row['Setting']['id']}</td>";
                    echo "<td>{$row['Setting']['key']}</td>";
                    echo "<td>{$row['Setting']['value']}</td>";
                    echo "<td>{$this->Html->link(__('Edit'), array('action' => 'edit', $row['Setting']['id']), array('class' => 'btn btn-warning'))}</td>";
                    echo "</tr>";
                }
                ?>
            </tbody>
        </table>

        <div class="pagination">
            <ul>
                <?php
                echo '<li>' . $paginator->first("First") . '</li>';
                if ($paginator->hasPrev()) {
                    echo '<li>' . $paginator->prev("Prev") . '</li>';
                }
                // the 'number' page buttons
                echo $paginator->numbers(array('modulus' => 3, 'tag' => 'li', 'separator' => '', 'currentTag' => 'a', 'currentClass' => 'active'));

                // for the 'next' button
                if ($paginator->hasNext()) {
                    echo '<li>' . $paginator->next("Next") . '</li>';
                }
                // the 'last' page button
                echo '<li>' . $paginator->last("Last") . '</li>';
                ?>
            </ul>
        </div>
    </div>
</div>
